<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../js/jquery-3.3.1.js"></script>
</head>
<body>
	<a href="../InsertOrderByBookIdServlet?bookId=1">直接购买</a>
	<a id="getallOrder" href="#">获取全部订单信息</a>
	<a id="getMyOrder" href="#">获取我的订单信息</a>
	<a id="getOneOrder" href="#">获取一个订单信息</a>
	<form action="PayServlet" method="post">
		<input name="bankId" type="hidden" value="CCB-NET-B2C"></input>
		<input name="orderId" type="hidden" value="1528015189774"></input>
		<button type="submit">支付</button>
	</form>
	
	<a id="updateOrderDetail" href="#">更新订单详情</a>
	
</body>
<script>
	$("#getallOrder").click(
		function(){
			$.post("../GetAllOrdersServlet",function(data,status) {
				console.log(data);
			})
		}		
	)
	
	$("#getMyOrder").click(
		function(){
			$.post("../GetMyOrdersServlet",function(data,status) {
				console.log(data);
			})
		}		
	)
	
	$("#getOneOrder").click(
		function(){
			$.post("../FetchOrderDetailsServlet",{OrderId:0},function(data,status) {
				console.log(data);
			})
		}		
	)
	
	$("#updateOrderDetail").click(
		function(){
			$.post("../AlterSingleOrderItemServlet",{OrderId:0,BookId:2,NewQuantity:0},function(data,status) {
				console.log(data);
			})
		}		
	)
	
</script>
</html>